package com.hackintosh.shopping;

/**
 * @description：
 * @author：twislyn
 * @date：Created in 2021/05/15
 * @modified By：
 * @version: 1.0
 */
public class Goods implements Article {
    private String name;
    private int quantity;
    private float unitPrice;

    public Goods(String name, int quantity, float unitPrice) {
        this.name = name;
        this.quantity = quantity;
        this.unitPrice = unitPrice;
    }

    @Override
    public float calculate() {
        return quantity*unitPrice;
    }

    @Override
    public void show() {
        System.out.println(name + "(数量：" + quantity + "，单价：" + unitPrice + "元)");
    }
}
